<?php
/******************************************************************************
 * Author: michal
 * Last modified: 2010-12-09 16:57
 * Filename: general_show_topic.view.php
 * Extends: base_2col.view.php
 * Description:	话题页面
 * 继承的变量:
 * $title,$user,$sitename,$lang,$arrowPosition,$extrahead,$lefthtml,$righthtml
 * $sendboxhead
 * 新声明的变量:
 * $huati 热门话题列表，不设置则显示 "没有热门话题"
 * 变量列表:
 * $title,$user,$sitename,$lang,$arrowPosition,$extrahead,$lefthtml,$righthtml
 * $huati,$sendboxhead
 * 已使用的变量:
 * $extrahead,$righthtml,$lefthtml,$sendboxhead
 * 子模板可用变量:
 * $title,$user,$sitename,$lang,$arrowPosition
 * $huati
******************************************************************************/
?>
<?php
//插入脚本
ob_start();
?>
<script type="text/javascript" src="./js/wbfuncs.js"></script>
<script type="text/javascript" src="./js/updateTime.js"></script>
<script>
$(function(){
	$(".sendbox").find("textarea").val("#<?php echo $ht["text"]; ?>#".replace("&lt;","<").replace("&gt;",">"));
	MSG.countTxt();
});</script>
<style>
	.right{padding-top:10px;}
	.navarrow{display:none;}
</style>
<style>
	/* 话题页 */
	.tcontainer{margin-left: 10px;min-height: 900px;width: 570px;}
	.huatimain{width:590px;padding-top:5px;}
	.huatimain a.htflowaction{display:inline-block;width:73px;height:21px;}
	.huatimain a.htflowaction.shouting{background-position:-59px -32px;}
	.huatimain a.htflowaction.quxiao{background-position:-59px -55px;}
	.huatibanner{margin:0 10px;max-width:570px;overflow:hidden;_ width:570px;}
	.huatides{margin:0 10px;max-width:590px;word-wrap:break-word;}
</style>
<!--[if lte IE 6]>
<style>
	.huatimain .sendboxwrapper .sendbox .txtandbutton{bottom:-15px;/*fix PIE.htc bug ie6下貌似会忽略margin position为absolute时显示错误*/}
</style>
<![endif]-->
<?php
$extrahead = ob_get_contents();
ob_end_clean();
ob_start();
//左侧DOM
?>
<div class="huatimain">
	<?php 
		if( isset($event) && array_key_exists("ext1",$event) && !empty($event["ext1"]) ){
			echo "<div class=\"huatibanner\">".$event["ext1"]."</div>";
		}else{
			echo "<!--活动大图-->";
		}
	?>
	<?php 
		if(isset($event) && array_key_exists("ext2",$event) && !empty($event["ext2"]) ){
			echo "<div class=\"huatides\">".$event["ext2"]."</div>";
		}else{
			echo "<!--活动说明-->";
		}
	?>
	<div class="sendboxwrapper leftbox">
	<?php
			$sendboxhead = "<div class=\"gray\" style=\"padding-left:20px;* margin:0 0 10px;\"><a class=\"usebtns htflowaction ".($ht["isfav"]?"quxiao":"shouting")."\" id=\"".$ht["id"]."\" style=\"margin-top:4px;\" href=\"javascript:;\"></a></div>";
			require pathJoin( TEMPLATE_DIR,'common','sendbox.view.php' ); 
	?>
	</div>
	<div class="tabbar" style="margin:10px 10px 0;width:570px;">
		<ul class="tabs">
			<li class="active">大家在说</li><li><a href="./index.php?m=searcht&k=<?php echo urlencode($ht["text"]);?>" target="_blank">相关搜索</a></li><li></li><li></li>
		</ul>
	</div>
	<div class="leftbox tcontainer">
		<div class="ttitle"><b class="guangbo"></b><span>一共有<?php echo $ht["tweetnum"]; ?>条广播</span></div>
		<?php 
			require pathJoin( TEMPLATE_DIR,'common','tbody.view.php' ); 
		?>
	</div>
</div>
<?php require pathJoin( TEMPLATE_DIR,'common','pagination.view.php' ); ?>
<?php
$lefthtml = ob_get_contents();
ob_end_clean();
ob_start();
//右侧DOM
?>
<div class="eventWrapper">
	<?php
		if( isset($event) && array_key_exists("ext3",$event) && !empty($event["ext3"]) ) {
	?>
	<div class="eventitem eventintro">
		<div class="eventtitle">活动简介</div>
		<div class="eventtext">
			<div class="eventtextcontent"><?php echo $event["ext3"];?></div>
			<div class="eventtextfooter"></div>
		</div>
	</div>
	<?php }else{ ?>
		<!-- 活动简介 -->
	<?php } ?>
		<?php
		if( isset($event) && array_key_exists("ext4",$event) && !empty($event["ext4"]) ) {
	?>
	<div class="eventitem eventintro">
		<div class="eventtitle">相关链接</div>
		<div class="eventtext">
			<div class="eventtextcontent"><?php echo $event["ext4"];?></div>
			<div class="eventtextfooter"></div>
		</div>
	</div>
	<?php }else{ ?>
		<!-- 相关链接 -->
	<?php } ?>
</div>
<?php 
	if( isset($event) && array_key_exists("recommend",$event) && !empty($event["recommend"]) ){
		echo "<div class=\"rightsp\" ></div>";
		foreach( $event["recommend"] as $re_mod ){
			echo "<div class=\"toggle toggleautoctrl\">".$re_mod["name"]."<a class=\"icon up\" title=\"收起\" href=\"javascript:void(0);\"></a></div>";
			$avatars = array(
				"perline" => 3,
				"info" => $re_mod["data"],
			);
			echo "<div style=\"padding:0px 10px;\">";
			require pathJoin( TEMPLATE_DIR,'common','avatars.view.php' );
			if( array_key_exists("hasmore",$re_mod) && $re_mod["hasmore"]){
				echo "<div class=\"clearleft toright h18 top10\"><a class=\"viewall\" href=\"./index.php?m=eventshowuser&eventname=".$ht["text"]."&eventmod=".$re_mod["name"]."\"></a></div>";
			}
			echo "</div>";
			echo "<div class=\"rightsp\" ></div>";
		}
	}
?>
<?php 
	require pathJoin( TEMPLATE_DIR,'common','recommend_topic.view.php' ); 
?>
<div class="rightsp" ></div>
<?php 
	require pathJoin( TEMPLATE_DIR,'common','fav_topic.view.php' ); 
?>
<div class="rightsp" ></div>
<?php
$righthtml = ob_get_contents();
ob_end_clean();
require_once pathJoin( TEMPLATE_DIR,'base_2col.view.php' );
?>
